package com.ileaf.pattern01.observable;

import com.ileaf.pattern01.observer.Observer;

/**
 * 观察某个文本，发生改变时通知相应观察者
 */
public class TextObservable extends Observable {

    @Override
    public void notifyObserver(Observer observer) {
        if (super.observerList.contains(observer)) {
            observer.update();
        }
    }

    @Override
    public void notifyAllObserver(Observer... observer) {
        System.out.println("override notifyAllObserver method");
    }
}